import request from '@/utils/request'
// 添加评论
export async function addComment(data) {
  return await request({
    url: '/comment/addComment',
    method: 'post',
    data
  })
}

// 获取评论
export async function findComments(data) {
  return await request({
    url: '/comment/findComments',
    method: 'get',
    params: { articleId: data.articleId, userId: data.userId }
  })
}

// 评论点赞
export async function like(data) {
  return await request({
    url: '/comment/like',
    method: 'get',
    params: { userId: data.userId, articleId: data.articleId, commentId: data.commentId }
  })
}

// 取消评论点赞
export async function disLike(data) {
  return await request({
    url: '/comment/dislike',
    method: 'get',
    params: { userId: data.userId, articleId: data.articleId, commentId: data.commentId }
  })
}
